import { Color, ShaderMaterial } from "three";
import vertex from "@/shader/ground-shadow/vertex.glsl"
import fragment from "@/shader/ground-shadow/fragment.glsl"

const colors = {
  brown: "#692c02",
  beige: "#9b5d2b",
  yellow: "#6c530b",
  green: "#424715",
  blue: "#2e4c5b"
};

export default function groundShadow(texture, colorName) {
  const color = colors[colorName];
  return new ShaderMaterial({
    vertexShader: vertex,
    fragmentShader: fragment,
    transparent: true,
    uniforms: {
      uTexture: {
        value: texture
      },
      uColor: {
        value: new Color(color)
      }
    }
  });
}
